﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SMS.Business.Roles
{
    public class RolesBusiness : BusinessBase<SMS.DAL.Role,SMS.DAL.Providers.RoleSearchCriteria>
    {
        SMS.DAL.Providers.RoleProvider RP;

        public RolesBusiness()
        {
            RP = new DAL.Providers.RoleProvider();
        }
        public override bool Insert(DAL.Role item)
        {
            try
            {
                RP.Insert(item);
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        public override bool Update(DAL.Role updatedItem)
        {
            try
            {
                RP.Update(updatedItem);
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        public override bool Delete(int id)
        {
            throw new NotImplementedException();
        }

        public override DAL.Role GetByID(int id)
        {
            throw new NotImplementedException();
        }

        public override List<DAL.Role> Search(DAL.Providers.RoleSearchCriteria SearchCriteria)
        {
            return RP.Search(SearchCriteria);
        }
    }
}
